﻿$(function() {
  $win = $(window);

  $("[modal]").on('click', function() {
    var selector = $(this).attr('modal');
    $(selector).modal('open')
  });

  // 页脚居底
  function commonFooterOnBottom() {
    var commonFooter = $('.footer-on-bottom');
    var commonHeader = $('.common-header');
    var commonMain = $(".select-library")

    var onBottomofFooterH = $win.height() - commonHeader.outerHeight() - commonFooter.outerHeight();

    commonMain.css({
      height: onBottomofFooterH
    });
  }
  if ($('.footer-on-bottom').length > 0) {
    commonFooterOnBottom()
  }
  window.commonFooterOnBottom = commonFooterOnBottom;

  $win.on('resize', function(){
    commonFooterOnBottom();
  })
});